From: Jonas Dreßler Date: Fri, 26 Feb 2021 14:52:06 +0000 (+0100) Subject: keyboard: Initialize the FocusTrackers current window correctly X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~136 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3acf840c998db5e788169d962dbe5634535ae3b6;p=gnome-shell.git keyboard: Initialize the FocusTrackers current window correctly The FocusTracker keeps track of the currently focused window using its internal this._currentWindow property. It will only pick up the focused window though when receiving a "notify::focus-window" signal, so the focused window that's set when the FocusTracker is created won't be picked up. Fix that by setting the _currentWindow during creation of the FocusTracker. Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index d7c07c0c6..0f01589fd 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -550,7 +550,6 @@ var KeyboardModel = class { var FocusTracker = class { constructor() { - this._currentWindow = null; this._rect = null; this._notifyFocusId = global.display.connect('notify::focus-window', () => { @@ -558,6 +557,8 @@ var FocusTracker = class { this.emit('window-changed', this._currentWindow); }); + this._setCurrentWindow(global.display.focus_window); + this._grabOpBeginId = global.display.connect('grab-op-begin', (display, window, op) => { if (window == this._currentWindow && (op == Meta.GrabOp.MOVING || op == Meta.GrabOp.KEYBOARD_MOVING))